package com.qidian.mespro.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ author: 周晓轩
 * @ company 起点编程
 * @ time: 2025/9/17 - 15:26
 * @ Description:
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

 @Override
 public void addCorsMappings(CorsRegistry registry) {
  registry.addMapping("/**")
          .allowedOriginPatterns("*")
          .allowCredentials(true)
          .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
          .maxAge(3600);
 }
}